import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class SearchPage extends StatefulWidget {
  String title;

  // const SearchPage({Key? key}) : super(key: key);
  SearchPage(this.title);

  @override
  _SearchPageState createState() => _SearchPageState(myTitle: this.title);
}

class _SearchPageState extends State<SearchPage> {
  String myTitle;

  _SearchPageState({this.myTitle = "测试"});

  // _SearchPageState({this.myTitle});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      floatingActionButton: FloatingActionButton(
        onPressed: () {
          Navigator.of(context).pop();
        },
        child: Text("返回"),
      ),
      appBar: AppBar(
        title: Text(this.myTitle),
      ),
      body: Text("我是搜索的内容"),
    );
  }
}
